ci: Combine UBSAN and ASAN by default
authorColin Walters <walters@verbum.org>
Thu, 8 Dec 2016 02:26:43 +0000 (21:26 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 9 Dec 2016 18:05:53 +0000 (18:05 +0000)
I only recently realized this was possible.  While we're still seeing
leaks in the CI environment for some reason, adding ASAN gives us
use-after-free detection etc., which is obviously still very useful
even if we're not doing leak checking.

Closes: #622
Approved by: jlebon

.redhat-ci.Dockerfile
.redhat-ci.yml
Makefile-tests.am

index f1a4129968a8850057406bef41f43935654fd696..c78e5c4cb997119d860f4c6422284bf8d443c250 100644 (file)
@@ -11,6 +11,8 @@ RUN dnf install -y \
         parallel \
         clang \
         libubsan \
+        libasan \
+        libtsan \
         gnome-desktop-testing \
         redhat-rpm-config \
         elfutils \
index 33e329955c39ba1947362b893152398695b4fc06..5160b9c41f1a5597caa9e8126ac96ead69840e3a 100644 (file)
@@ -8,8 +8,13 @@ required: true
 container:
     image: projectatomic/ostree-tester
 
+packages:
+  - libasan
+
 env:
-    CFLAGS: '-fsanitize=undefined'
+    CFLAGS: '-fsanitize=undefined -fsanitize=address'
+    ASAN_OPTIONS: 'detect_leaks=0'  # Right now we're not fully clean, but this gets us use-after-free etc
+    # TODO when we're doing leak checks: G_SLICE: "always-malloc"
 
 build:
     config-opts: >
index 8c37a6e6e6b0a27a142f004b957c135e364ea488..1f9cad48b5bccc5f25b37e3b9062855a2c6646f1 100644 (file)
@@ -281,18 +281,15 @@ tests/%-symlink-stamp: % Makefile
 # non-recursive Automake, so we change our code to canonically look
 # for tests/ which is just a symlink when installed.
 if ENABLE_INSTALLED_TESTS
-install-test-data-file-path-hack:
+install-installed-tests-extra:
        if test -L $(DESTDIR)$(installed_testdir)/tests; then \
          rm $(DESTDIR)$(installed_testdir)/tests; \
        fi
        ln -s . $(DESTDIR)$(installed_testdir)/tests
-INSTALL_DATA_HOOKS += install-test-data-file-path-hack
-
-install-libtest:
 if BUILDOPT_ASAN
        sed -e 's,^BUILT_WITH_ASAN=.*,BUILT_WITH_ASAN=1,' < $(srcdir)/tests/libtest.sh > $(DESTDIR)$(installed_testdir)/tests/libtest.sh
 else
        install -m 0644 $(srcdir)/tests/libtest.sh $(DESTDIR)$(installed_testdir)/tests/libtest.sh
 endif
-INSTALL_DATA_HOOKS += install-libtest
+INSTALL_DATA_HOOKS += install-installed-tests-extra
 endif